package com.danbay.cloud.deviceaccess.api.service;

import com.danbay.cloud.deviceaccess.api.dto.ReportEmWarning;
import com.danbay.cloud.deviceaccess.api.dto.ReportKwh;
import com.danbay.cloud.deviceaccess.api.dto.ReportWm;
import com.danbay.cloud.deviceaccess.api.dto.ReportWmWarning;
import com.danbay.cloud.deviceaccess.api.dto.lock.*;
import com.danbay.cloud.deviceaccess.api.dto.meter.ReportRelay;
import com.danbay.cloud.deviceaccess.api.dto.meter.ReportVolt;
import com.danbay.cloud.deviceaccess.api.dto.meter.ReportWater;
import com.danbay.framework.exception.BusinessException;
import com.danbay.framework.springnc.annotation.AutoController;
import com.danbay.framework.springnc.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 设备数据上报服务
 * @author SJG
 *         2017/11/21.
 */
@AutoController
@RequestMapping("/status")
public interface IDeviceReportService {

    ////////////////////////////////////////水电表信息上报/////////////////////////////////////////////////////

    /**
     * 3.1	水表水量统计信息上报
     * @param reportWm 水表水量统计信息
     * @throws BusinessException 业务异常
     */
    @RequestMapping("/report_wm")
    void reportWm(@RequestBody ReportWm reportWm) throws BusinessException;

    /**
     * 3.2	水表报警信息上报
     * @param wmWarning 水表报警信息
     * @throws BusinessException 业务异常
     */
    @RequestMapping("/report_wm_warning")
    void reportWmWarning(@RequestBody ReportWmWarning wmWarning) throws BusinessException;

    /**
     * 3.1	电表电能量信息上报
     * @param reportKwh 电表电能量信息
     * @throws BusinessException 业务异常
     */
    @RequestMapping("/report_kwh")
    void reportKwh(@RequestBody ReportKwh reportKwh) throws BusinessException;

    /**
     * 有线水电表采集器数据上报
     * @param reportWater
     * @throws BusinessException
     */
    @RequestMapping("/report_water")
    void reportWater(@RequestBody ReportWater reportWater) throws BusinessException;

    /**
     * 远程获取电表瞬时功率
     * @param reportVolt
     * @throws BusinessException
     */
    @RequestMapping(value = "/report_power")
    void reportPower(@RequestBody ReportVolt reportVolt) throws BusinessException;

    /**
     * 远程获取电表电压测量信息
     * @param reportVolt
     * @throws BusinessException
     */
    @RequestMapping(value = "/report_volt")
    void reportVolt(@RequestBody ReportVolt reportVolt) throws BusinessException;

    /**
     * 远程获取电表电流测量信息
     * @param reportVolt
     * @throws BusinessException
     */
    @RequestMapping(value = "/report_current")
    void reportCurrent(@RequestBody ReportVolt reportVolt) throws BusinessException;

    /**
     * 远程获取电表功率因素测量信息
     * @param reportVolt
     * @throws BusinessException
     */
    @RequestMapping(value = "/report_pf")
    void reportPF(@RequestBody ReportVolt reportVolt) throws BusinessException;

    /**
     * 电表继电器状态上报,用于判断电表拉合闸按钮
     * @param reportRelay
     * @throws BusinessException
     */
    @RequestMapping(value = "/report_relay",method = RequestMethod.POST)
    void reportRelay(@RequestBody ReportRelay reportRelay) throws BusinessException;

    ///////////////////////////////////////门锁信息上报/////////////////////////////////////////////////////

    /**
     * 门锁的开门信息上报
     * @throws BusinessException 业务异常
     */
    @RequestMapping(value = "/open_door")
    void reportOpenDoor(@RequestBody OpenDoorReport openDoorReport) throws BusinessException;

    /**
     * 3.6	电表/门锁报警信息上报
     * @param emWarning 电表报警信息
     * @throws BusinessException 业务异常
     */
    @RequestMapping("/warning")
    void reportWmWarning(@RequestBody ReportEmWarning emWarning) throws BusinessException;

    /**
     * 门锁权限动态信息上报
     * @param accessReport
     * @throws BusinessException
     */
    @RequestMapping(value = "/access")
    void lockAccess(@RequestBody AccessReport accessReport) throws BusinessException;

    /**
     * 门锁锁舌状态信息上报
     * @param tongueReport
     * @throws BusinessException
     */
    @RequestMapping(value = "/tongue")
    void tongueReport(@RequestBody TongueReport tongueReport) throws BusinessException;

    /**
     * 门锁的密码别名更新结果上报
     * @param aliasResult
     * @throws BusinessException
     */
    @RequestMapping(value = "/alias_result")
    void aliasResultReport(@RequestBody AliasResult aliasResult) throws BusinessException;

    /**
     * 门锁数据的定期同步
     * @param dataSync
     * @throws BusinessException
     */
    @RequestMapping(value = "/data_sync")
    void dataSyncReport(@RequestBody DataSync dataSync) throws BusinessException;

    /**
     * 门锁密码同步
     * @param alias
     * @throws BusinessException
     */
    @RequestMapping(value = "/pass_sync")
    void passSyncReport(@RequestBody Alias alias) throws BusinessException;
}
